//
//  SourceDetailViewController.m
//  TableBarControllerDemo
//
//  Created by 边果互动 on 2021/3/18.
//

#import "SourceDetailViewController.h"
#import "BannerView.h"

@interface SourceDetailViewController ()

@end

@implementation SourceDetailViewController

- (void)viewDidDisappear:(BOOL)animated {
    [((BannerView *) self.tableView.tableHeaderView) stopTimer];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationItem.title = @"资源详情";
    self.navigationItem.leftBarButtonItem = [self customBackBtn];
    
    NSMutableArray *list = [NSMutableArray array];
    [list addObject:@"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=3571529949,229356399&fm=26&gp=0.jpg"];
    [list addObject:@"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2071531164,3511861342&fm=26&gp=0.jpg"];
    [list addObject:@"https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=3330665574,4010079980&fm=11&gp=0.jpg"];
    [list addObject:@"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2036390322,794403834&fm=26&gp=0.jpg"];
    [list addObject:@"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=1902934933,556456904&fm=26&gp=0.jpg"];
    
    BannerView *bannerView = [BannerView bannerWithUrls:list];
    self.tableView.tableHeaderView = bannerView;
    [self.view addSubview:self.tableView];
}

#pragma mark - UITableDataSource代理
//返回有几组
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 0;
}

//返回每组有几行
- (NSInteger) tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 1;
}

//返回每一行的cell
- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    return nil;
}

//返回每一行的高度
- (CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
    return 45;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
